package com.gitee.loyo.utils;

import io.vertx.core.Future;
import io.vertx.core.Vertx;

public class NetUtils {

    public static Future<Void> ping(String host, int port){
        return Vertx.currentContext().owner().createNetClient().connect(port, host).compose(
            netSocket -> {
                netSocket.close();
                return Future.succeededFuture();
            }
        );
    }
}
